package com.bjsdzk.collector.rpc;

import com.bjsdzk.collector.mapper.CommandMapper;
import com.bjsdzk.collector.one2one.HostServer;
import lombok.Getter;
import lombok.Setter;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.stereotype.Component;

import com.bjsdzk.backend.rpc.Platform2Service;
import com.bjsdzk.collector.config.DubboFilter;

import javax.annotation.PostConstruct;

/**
 * @author pc
 */
@Component
public  class MockPlatformServiceImpl implements Platform2Service{
	private static final Logger logger = LoggerFactory.getLogger(MockPlatformServiceImpl.class);

	private static RedisTemplate<String,String> redisTemplate;

	@Autowired
	private RedisTemplate<String,String> r;

	@PostConstruct
	public void beforeInit() {
		redisTemplate = r;
	}

	@Override
	public void deviceAdd(String msg) {
		logger.error("Platform2Service deviceAdd No provider  please check zk or server");
	}

	@Override
	public void deviceRemove(String msg) {
		logger.error("Platform2Service deviceRemove No provider  please check zk or server");
	}

	@Override
	public void deviceStart(String msg) {
		logger.error("Platform2Service No provider  please check zk or server");
	}

	@Override
	public void deviceStop(String msg) {
		logger.error("Platform2Service  deviceStop No provider  please check zk or server");
	}

	@Override
	public void sendCmd(String msg) {
		logger.error("Platform2Service sendCmd No provider  please check zk or server");
	}

	@Override
	public void ping(String msg) {
		logger.error("Platform2Service ping No provider  please check zk or server");
	}

	@Override
	public void statusChange(String msg) {
		logger.error("Platform2Service statusChange No provider  please check zk or server");
	}

	@Override
	public void warn(String msg) {
		logger.error("Platform2Service warn No provider  please check zk or server");
	}

	@Override
	public void error(String msg) {
		logger.error("Platform2Service error No provider  please check zk or server");
	}

	@Override
	public void fault(String msg) {
		logger.error("Platform2Service fault No provider  please check zk or server");
	}

	@Override
	public void faultChannel(String msg) {
		logger.error("Platform2Service faultChannel No provider  please check zk or server");
	}

	@Override
	public void faultDevice(String msg) {
		logger.error("Platform2Service faultDevice No provider  please check zk or server");
	}

	@Override
	public void callback(String msg) {
		logger.error("Platform2Service callback No provider  please check zk or server");
	}

	@Override
	public void data(String msg) {
		logger.error("Platform2Service data No provider  please check zk or server");
	}

	@Override
	public String getParamsByport(String msg) {
		logger.error("Platform2Service getParamsByport No provider  please check zk or server");
		return redisTemplate.opsForValue().get(HostServer.YRWGDATA);
	}

}
